/*
*@file ajax.js
*@author ahmed atta
*  Include some functions of special requesting by Ajax
*/
//=========================================//
/*
** To get Hejri Date 
*
*/
function getHejri(ele_button)
{
	$(document).ready(function(){
      $.ajax(
      {
        beforeSend:function (XMLHttpRequest){
        // $(".loading").fadeOut();              
        },
        data: {submitForm:'M-to-H', meladyDate:$("#datepicker").val()} , 
        success:function (xml){
          //  $("#loading").fadeIn();  
            $("#hejriDate").html($(xml).find('hejri').text());
        }, 
        type:"post", 
		dataType: "xml",
        url:"./inc/hejri.php"
      }
    );   
    });  
	return false;
}
//============================================= //
/*
* To get time prayers
*
**/
function getTimePrayers(today)
{
	$(document).ready(function(){
      $.ajax(
      {
        beforeSend:function (XMLHttpRequest){
        // $(".loading").fadeOut();              
        },
        data: {submitForm:'TimePrayers', Country:$("#tpCountry").val(), Method:$("#tpMethod").val()} , 
        success:function (data){
          //  $("#loading").fadeIn(); 
			var praytime = '<table width="100%" cellspacing="1" cellpadding="3" bgcolor="#a9c6f7" style="color:red"><tbody>';
			praytime +='<tr><td colspan="6" bgcolor="#eeeeee">'+ today +'</td></tr>';
			praytime +='<tr><td  bgcolor="#FFFFFF">الفجر</td>';
			praytime +='<td bgcolor="#FFFFFF">الشروق</td>';
			praytime +='<td  bgcolor="#FFFFFF">الظهر</td>';
			praytime +='<td  bgcolor="#FFFFFF">العصر</td>';
			praytime +='<td  bgcolor="#FFFFFF">المغرب</td>';
			praytime +='<td  bgcolor="#FFFFFF">العشاء</td></tr>';
			praytime +='<tr><td  bgcolor="#FFFFFF">'+ data [0] +'</td>';
			praytime +='<td  bgcolor="#FFFFFF">'+ data [1] +'</td>';
			praytime +='<td  bgcolor="#FFFFFF">'+ data [2] +'</td>';
			praytime +='<td  bgcolor="#FFFFFF">'+ data [3] +'</td>';
			praytime +='<td  bgcolor="#FFFFFF">'+ data [4] +'</td>';
			praytime +='<td bgcolor="#FFFFFF">'+ data [6] +'</td></tr>';
			praytime +='</tbody></table>';
            $("#praytime_out").html(praytime);
        }, 
        type:"post", 
		dataType: "json",
        url:"./inc/ajax_praytimes.php"
      }
    );   
    });  
	return false;
}